#pragma once

#include <memcached.h>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <map>
#include <unistd.h>
#include <time.h>
#include <stdlib.h>
#include <poll.h>
#include <iostream>

using namespace std;

class CMemcacheClient
{
public:
    CMemcacheClient();
    bool Init(const char* host, int port);
    bool Connect();
    bool SetRecord(const char* key, const char* value, const size_t bytes, const time_t expire = 0);
    bool DeleteRecord(const char* key);
    string GetRecord(const char* key);

private:
    memcached_return rc;
    memcached_st *memc;
    uint64_t cas;
    string host;
    int port;
};

